<section class="content-header">
  <ol class="breadcrumb">
    <li><a ui-sref="dashboard"><i class="fa fa-dashboard"></i>我的面板</a></li>
    <li><a ui-sref="customer">正式客户列表</a></li>
    <li class="active">详情</li>
  </ol>
</section>
<section class="content">
  <div class="box box-danger">
    <div class="box-header with-border">
      <h3 class="box-title">基本信息</h3>
      <div class="box-tools pull-right">
        <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
        </button>
      </div>
    </div>
    <form class="form-horizontal view-form">
      <div class="box-body">
        <div class="form-group">
          <label class="col-sm-2 control-label">客户编号:</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.code"></span>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">客户名称:</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.name"></span>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">标签:</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.tag"></span>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">所属行业:</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.industry"></span>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">客户来源:</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.source"></span>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">介绍人:</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.source_name"></span>
          </div>
        </div>

        <div class="form-group mb-0">
          <label class="col-sm-2 control-label">详细地址:</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.province + data.city + data.county + data.address"></span>
          </div>
        </div>

        <div class="form-group mb-0">
          <label class="col-sm-2 control-label">寄件地址:</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.mailling_province + data.mailling_city + data.mailling_county + data.mailling_address"></span>
          </div>
        </div>

        <div class="form-group">
          <label class="col-sm-2 control-label">传真:</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.fax"></span>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">业务员:</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.salesman"></span>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">助理:</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.assistant_name"></span>
          </div>
        </div>
        <div class="form-group" ng-repeat="assistant in data.assistantList">
          <label class="col-sm-2 control-label"></label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="assistant.name"></span>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">备注:</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.description"></span>
          </div>
        </div>
      </div>
      <div class="box-footer">
        <!-- <button type="button" class="btn btn-default" ng-click="cancel()">取消</button> -->
        <button type="button" class="btn btn-info" ui-sref="customer_edit({id: id})" ui-sref-opts="{reload:true}">修改</button>
      </div>
    </form>
  </div>
  <div class="box box-danger">
    <div class="box-header with-border">
      <h3 class="box-title">联系人</h3>
      <div class="box-tools">
        <div class="box-tools pull-right">
          <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
          </button>
        </div>
      </div>
    </div>
    <div class="box-body table-responsive no-padding">
      <table class="table table-hover">
        <tbody>
          <tr>
            <th style="width: 10px">#</th>
            <th>联系人</th>
            <th>对接事务</th>
            <th>手机</th>
            <th>座机</th>
            <th>职务</th>
            <th>邮箱</th>
            <th>QQ</th>
            <th>微信</th>
            <th>备注</th>
          </tr>
          <tr ng-repeat="item in data.contactList">
            <td ng-bind="($index+1)+'.'"></td>
            <td ng-bind="item.name"></td>
            <td ng-bind="item.responsable"></td>
            <td ng-bind="item.mobile"></td>
            <td ng-bind="item.tel"></td>
            <td ng-bind="item.position"></td>
            <td ng-bind="item.email"></td>
            <td ng-bind="item.QQ"></td>
            <td ng-bind="item.wechat"></td>
            <td ng-bind="item.memo"></td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
  <div class="box box-danger">
    <div class="box-header with-border">
      <h3 class="box-title">附件</h3>
      <div class="box-tools">
        <div class="box-tools pull-right">
          <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
          </button>
        </div>
      </div>
    </div>
    <div class="box-body table-responsive no-padding">
      <table class="table table-hover">
        <tbody>
          <tr>
            <th style="width: 10px">#</th>
            <th>名称</th>
            <th>附件</th>
            <th>上传时间</th>
            <th>备注</th>
            <th class="opt-col">操作</th>
          </tr>
          <tr ng-repeat="item in attachments">
            <td ng-bind="($index+1)+'.'"></td>
            <td ng-bind="item.name"></td>
            <td>
              <a href="{{item.attachment_url}}" target="_blank" ng-if="item.attachment_url.length">
                        点击查看
                    </a>
            </td>
            <td ng-bind="format(item.date_created, 'YYYY-MM-DD')"></td>
            <td ng-bind="item.description"></td>
            <td class="opt-col">
              <a href="javascript:;" class="fa fa-trash-o red" ng-click="deleteAttachment(item)" title="删除"></a>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    <div class="box-footer clearfix">
      <button type="button" class="btn btn-info" ui-sref=".attachment({source_name: 'customer', source_id: data.id})" ui-sref-opts="{location:false}">新增</button>
    </div>
  </div>
  <div class="box box-danger">
    <div class="box-header with-border">
      <h3 class="box-title">开户行信息</h3>
      <div class="box-tools pull-right">
        <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
        </button>
      </div>
    </div>
    <div class="box-body table-responsive no-padding">
      <table class="table table-hover">
        <tbody>
          <tr>
            <th style="width: 10px">#</th>
            <th>开户行</th>
            <th>开户人</th>
            <th>银行账号</th>
            <th class="opt-col">操作</th>
          </tr>
          <tr ng-repeat="item in data.banks">
            <td ng-bind="($index+1)+'.'"></td>
            <td ng-bind="item.bank"></td>
            <td ng-bind="item.holder"></td>
            <td ng-bind="item.account"></td>
            <td class="opt-col">
              <a class="fa fa-pencil orange" ui-sref=".bank_edit({tid: {{item.id}}})" ui-sref-opts="{location:false}" title="修改"></a>
              <!-- <a href="javascript:;" class="fa fa-trash-o red" ng-click="delete(item)" title="删除"></a> -->
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    <div class="box-footer clearfix">
      <button type="button" class="btn btn-info" ui-sref=".bank_add" ui-sref-opts="{location:false}">新增</button>
    </div>
  </div>
  <div class="box box-danger">
    <div class="box-header with-border">
      <h3 class="box-title">在我司业务</h3>
      <div class="box-tools pull-right">
        <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
        </button>
      </div>
    </div>
    <div class="box-body table-responsive no-padding">
      <table class="table table-hover">
        <tbody>
          <tr>
            <th style="width: 10px">#</th>
            <th>订单类型</th>
            <th>档案号</th>
            <th>订单名称</th>
            <th>订单状态</th>
            <th>注册时间</th>
            <th>录入时间</th>
            <th class="opt-col">操作</th>
          </tr>
          <tr ng-repeat="item in orders">
            <td ng-bind="($index+1)+'.'"></td>
            <td ng-bind="item.order_type_name"></td>
            <td ng-bind="item.order_code"></td>
            <td ng-bind="item.order_name" ng-attr-title="{{item.order_name}}"></td>
            <td ng-bind="getStatus(item)"></td>
            <td ng-bind="format(item.date_setup, 'YYYY-MM-DD')"></td>
            <td ng-bind="format(item.date_created, 'YYYY-MM-DD HH:MM')"></td>
            <td class="opt-col">
              <a href="javascript:;" ng-click="orderDetail(item)"> 详情</a>
              <a href="javascript:;" ng-click="history(item)"> 变更</a>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</section>
<div ui-view="modal"></div>
<div ui-view="attachment"></div>
